package com.wms.core.token.login;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.log4j.Logger;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Repository;

import com.wms.dataSource.dSource;

@Repository
public class FindUserDao {
	
	private static final Logger logger = Logger.getLogger(FindUserDao.class);
	
	private SqlSessionFactory ssf;
	
	@Resource
	private dSource ds;
	
	public void setDs(dSource ds) {
		this.ds = ds;
	}

	public void setSsf(SqlSessionFactory ssf) {
		this.ssf = ssf;
	}
	
	@PostConstruct
	@Lazy
	public void init(){
		setSsf(ds.initinalDataSource(this.getClass().getName()));
	}
	
	
	public String getPwdByNam(String nam){
		
		return ssf.openSession().selectOne("getPwdByNam", nam);
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}
